package com.xm;

/**
 * @Author：xm
 * @Project：runoob
 * @Date：2024/7/15 20:47
 */

public class Generic062<T> {
    private T t;

    public void add(T t) {
        this.t = t;
    }

    public T get() {
        return t;
    }
    public static void main(String[] args) {
        Generic062<Integer> integerGeneric062 = new Generic062<>();
        Generic062<String> stringGeneric062 = new Generic062<>();

        integerGeneric062.add(new Integer(10));
        stringGeneric062.add("菜鸟教程");

        System.out.printf("整型值为：%d\n",integerGeneric062.get());
        System.out.printf("字符串为：%s\n",stringGeneric062.get());
    }
}
